/*package com.qhgrain.demo.authz;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginAuth {
	
	@RequestMapping("/doLogin")
	@ResponseBody
	public String login(String userName,String password){		
		  UsernamePasswordToken token = new UsernamePasswordToken(userName,password);
		  try {
		    	Subject subject = SecurityUtils.getSubject();
        		if(userName==null) {
        		    if(subject.isAuthenticated()) {
        		    	System.out.println("is auth");
        		    } else {        		    	
        		    	return "please login";
        		    }
        		} else {
                    subject.login(token);
        		}
			} catch(Exception e) {
			    e.printStackTrace();
			}
		return "ok";
	}	
}
*/